package com.jiliason.segmentation.entity.address;

import com.jiliason.segmentation.entity.SegmentInputPojo;
import com.jiliason.segmentation.utils.JsonUtil;
import lombok.Builder;
import lombok.Data;

@Builder
@Data
public class FullAddressOutPojo {
    private Integer statusCode;
    private String message;
    private String labeledAddress;
    private ResultAddressPojo resultAddress;

    /**
     * 没有分出来的通用响应
     */
    public String invalidResponse(SegmentInputPojo inputPojo) {
        this.resultAddress = ResultAddressPojo.builder()
                .originalValue(inputPojo.getAddrStr())
                .build();
        this.statusCode = 1;
        this.message = "";
        this.labeledAddress = "";
        return JsonUtil.pojoToJson(this);
    }
}
